//
//  Ball.m
//  OC作业
//
//  Created by dllo on 15/12/1.
//  Copyright © 2015年 dllo. All rights reserved.
//

#import "Ball.h"

@implementation Ball

//- (void)setName:(NSString *)name{
//    _name = name;
//}
//-(NSString *)name{
//    return _name;
//}
//- (void)setColor:(NSString *)color{
//    _color = color;
//}
//-(NSString *)color{
//    return _color;
//}
- (instancetype)initWithName:(NSString *)name
                       color:(NSString *)color{
    
    self = [super init];
    if (self) {
        _name = name;
        _color = color;
    }
    
    return self;
}



+ (instancetype)ballWithName:(NSString *)name
                       color:(NSString *)color{
    Ball *ball = [[Ball alloc] initWithName:name color:color];
    return ball;
}



@end
